package com.ly.consumer.util;

import java.util.List;

/**
 * @author YU
 * @create 2019-01-21 10:37
 * @desc JsTree数据demo
 **/
public class JsTree {

    /*内部类设置state属性*/
    public class State{
        private boolean opened = false;//默认开启状态
        private boolean selected = false;//默认选中状态

        public boolean isOpened() {
            return opened;
        }

        public void setOpened(boolean opened) {
            this.opened = opened;
        }

        public boolean isSelected() {
            return selected;
        }

        public void setSelected(boolean selected) {
            this.selected = selected;
        }

        @Override
        public String toString() {
            return "State{" +
                    "opened=" + opened +
                    ", selected=" + selected +
                    '}';
        }
    }

    private String id;
    private String lable;
    private List<?> children;
    //"state": {"opened" : true,"selected":true}
    private State state = new State();

    private Object data;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLable() {
        return lable;
    }

    public void setLable(String lable) {
        this.lable = lable;
    }

    public List<?> getChildren() {
        return children;
    }

    public void setChildren(List<?> children) {
        this.children = children;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "JsTree{" +
                "id='" + id + '\'' +
                ", lable='" + lable + '\'' +
                ", children=" + children +
                ", state=" + state +
                ", data=" + data +
                '}';
    }
}

